/*
 * cmd_efuse_simple_test.c
 *
 *  Created on: Nov 10, 2016
 *      Author: duobao
 */


/*
 * cmd_efuse_test.c
 *
 *  Created on: Sep 28, 2016
 *      Author: duobao
 */

#include "../drivers/crypto/mol_hw_sha.h"
#include <common.h>
#include <command.h>


int hw_sha_sum(cmd_tbl_t *cmdtp,int flag,int argc,char *argv[])
{
	char *endp;
	int ret;
    unsigned long mode = 0;
    unsigned long buff = NULL;
    unsigned long hkey = NULL;
    unsigned long len = 0;
    unsigned long keylen = 0;

    unsigned long dst = 0;
    
    if (argc != 7)
        return CMD_RET_USAGE;

	mode = simple_strtoul(argv[1], NULL, 16);
	buff = simple_strtoul(argv[2], &endp, 16);
	hkey = simple_strtoul(argv[3], &endp, 16);
	len = simple_strtoul(argv[4], &endp, 16);
	keylen = simple_strtoul(argv[5], &endp, 16);
	dst = simple_strtoul(argv[6], &endp, 16);
	
    hw_sha_mol(mode,buff,hkey,len,keylen,dst);
	return 0;
}

U_BOOT_CMD(

		hw_sha_sum,7,1,hw_sha_sum,"shasum by hw","usage:hw_sha_sum mode buff hkey len hklen dst \n"

);

int hw_sha_mol(HW_HASH_MODE mode,void* buff,void* hkey, unsigned long buflen ,unsigned long hkeysize,char* res);
